package com.study.opensource.spring.condition.config;

import com.study.opensource.spring.condition.annotation.ConditionalOnSystemProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 许棒棒
 * @className com.study.study.opensource.spring.condition.config.ConditionalMessageConfiguration
 * @description TODO 类描述
 * @date 2021/04/17 23:37:40
 */
@Configuration
public class ConditionalMessageConfiguration {

    @ConditionalOnSystemProperty(name = "language", value = "Chinese")
    @Bean("message")
    public String chineseMessage() {
        return "你好,世界";
    }

    @ConditionalOnSystemProperty(name = "language", value = "English")
    @Bean("message")
    public String englishMessage() {
        return "hello,world";
    }
}
